Socket
Socket
Sign inDemoInstall

@anchan828/gen-graphql-order-schema

Package Overview
Dependencies
Maintainers
1
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anchan828/gen-graphql-order-schema

Auto generation for order type


Version published
Weekly downloads
10
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

@anchan828/gen-graphql-order-schema

Description

Generate order schema by directive

Quick Start

import { genOrderTypes } from "@anchan828/gen-graphql-order-schema";
import { buildASTSchema, printSchema } from "graphql";

const schema = `

type Test {
  id: ID
}

type Query {
  tests: [Test] @orderBy
}

`;

printSchema(buildASTSchema(genOrderTypes(schema)));
//=>  enum OrderDirection {
//      ASC
//      DESC
//    }
//
//    type Query {
//      tests(orderBy: [TestOrder]): [Test]
//    }
//
//    type Test {
//      id: ID
//    }
//
//    type TestOrder {
//      sort: TestSort
//      direction: OrderDirection
//    }
//
//    enum TestSort {
//      ID
//    }

Options

TODO

Supoprted Types

For now, supported types are Basic Types (String, Int, Float, Boolean, ID), and Enum

License

MIT.

FAQs

Package last updated on 16 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc